#include "ObjMgr.h"
#include "RoleMgr.h"
#include "MagicExSet.h"

CRoleMgr* g_pRoleMgr = 0/*NULL*/;

CMagicExSet* g_pMagicExSet = 0;

#ifdef LUA_MAGIC
#include "ScriptMgr.h"
CScriptMgr* g_pScriptMgr = 0;
#endif

bool MgrInit()
{
#ifndef LUA_MAGIC
	g_pMagicExSet = new CMagicExSet;
	if (g_pMagicExSet)
	{
		g_pMagicExSet->Load();
	}
	else
	{
		exit(-1);
	}
#endif

	g_pRoleMgr = new CRoleMgr;
	if (g_pRoleMgr == NULL)
	{
		exit(-1);
	}

#ifdef LUA_MAGIC
	g_pScriptMgr = new CScriptMgr;
	if (g_pScriptMgr == NULL)
	{
		exit(-1);
	}
	g_pScriptMgr->Init();
#endif

	return true;
}